<%@ Page Language="C#" AutoEventWireup="true" CodeFile="links.aspx.cs" Inherits="Admin_links" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Add/Edit Links</title>
    <link rel="stylesheet" href="../css/style-admin.css" media="screen,projection" type="text/css" />

    <script src="../js/prototype.js" language="javascript" type="text/javascript"></script>

    <script src="../js/admin/link.js" language="javascript" type="text/javascript"></script>
    
    <script language="javascript" type="text/javascript">
    function deletelink(bookmarks_Id)
    {
        var callbackURL='../handlers/callback.ashx?status=link&mode=delete';
        var data='bookmarks_Id='+bookmarks_Id ;
        var myAjax=new Ajax.Request(
            callbackURL,
            {method: 'post', parameters: data, onComplete: valuesDeleted}
        );
    }
    
    function valuesDeleted(originalRequest)
    {
        $('divLinks').innerHTML=originalRequest.responseText;
        Form.reset($('frmLinks'));
    }
    </script>

</head>
<body>
    <form id="frmLinks" runat="server">
        <table width="900">
            <tr>
                <td align="center" colspan="2" valign="middle" style="width: 450px;">
                    <h1>
                        Add/Edit Links</h1>
                    <a href="../default.aspx" target="_blank">View Site</a>
                </td>
                <td style="width: 450px; vertical-align: top;" rowspan="6">
                    <div id="divLinks">
                        <% bll.getLinks(); %>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right">
                    URL:
                </td>
                <td>
                    <input id="txtURL" runat="server" class="text" size="25" type="text" />
                    <input id="txtBookmarks_Id" runat="server" type="hidden" /></td>
            </tr>
            <tr>
                <td align="right">
                    Title:
                </td>
                <td>
                    <input id="txtTitle" runat="server" class="text" size="25" type="text" />
                    0-100 Chars.</td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    Description:
                </td>
                <td valign="middle">
                    <input id="txtDescription" runat="server" class="text" size="25" type="text" />
                    0-100 Chars.</td>
            </tr>
            <tr>
                <td align="right">
                    Target:
                </td>
                <td>
                    <input id="chkTarget" type="checkbox" runat="server" /></td>
            </tr>
            <tr>
                <td align="center" colspan="2" valign="middle">
                    <input id="btnSubmit" onclick="enterValues();" style="font-size: 20px; width: 126px;
                        height: 45px" type="button" value="Submit" />
                    <div id="loadermsg">
                    </div>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
